﻿<Window x:Class="MContracts.Dialogs.ServerConnectionDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="Информационная система 'Учёт договорв'" SizeToContent="WidthAndHeight"
        WindowStartupLocation="CenterScreen" WindowStyle="None"
        ResizeMode="NoResize" MinWidth="300" BorderThickness="4" AllowsTransparency="False" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="268" d:DesignWidth="404" IsEnabled="True" ShowInTaskbar="False" BorderBrush="Navy" Opacity="1">
    <Window.Resources>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="MinWidth" Value="100"/>
        </Style>
        <Style TargetType="PasswordBox">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="MinWidth" Value="100"/>
        </Style>
        <Style TargetType="Button">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="MinWidth" Value="75"/>
        </Style>        
    </Window.Resources>

    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <!-- Header -->
        <StackPanel Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2">
            <Label HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"
                   FontWeight="Bold" FontSize="16">
                <StackPanel>
                    <Label>Вход в 'Учёт договоров'</Label>
                    <!--<Label Margin="0,0,0,0" FontWeight="Thin" FontSize="10">Учёт договоров</Label>-->
                </StackPanel>
            </Label>
        </StackPanel>
        <!-- Main Controls -->
        <Label Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" Content="Имя пользователя"/>
        <TextBox Grid.Column="1" Grid.Row="1" GotFocus="CredentialsFocussed" x:Name="txtUsername"/>
        <Label Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" Content="Пароль"/>
        <PasswordBox Grid.Column="1" Grid.Row="2" GotFocus="CredentialsFocussed" x:Name="txtPassword" />
        <Label Grid.Column="0" Grid.Row="3" Content="Сервер" HorizontalAlignment="Right" />
        <ComboBox x:Name="cbServerName" Grid.Column="1" Grid.Row="3" Margin="3,0" ItemsSource="{Binding Path=OracleDataSources}" DisplayMemberPath="InstanceName"/>
        <Label Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" HorizontalAlignment="Center" Foreground="Red" FontStyle="Italic" Visibility="{Binding ShowInvalidCredentials}" Content="*Имя пользователя или пароль введены не правильно" ToolTip="{Binding ExceptionTooltip}"/>
                
        <Label Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2" HorizontalAlignment="Center" Content="{Binding Path=OracleStatus}" Foreground="DarkRed" FontWeight="Bold"></Label>
        <StackPanel Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="5" HorizontalAlignment="Right" Height="Auto">
            <Button Content="Вход" Command="{Binding Path=TryConnectCommand}" IsDefault="True" Click="Button_Click_1" />
            <Button Content="Отмена" Click="Button_Click" />
        </StackPanel>

    </Grid>
</Window>
